Skip to content

Improvement#11

Merged
saimizi merged 3 commits intomainfrom
feature/improvment-pririty-1
Dec 26, 2025
Merged

Improvement#11
saimizi merged 3 commits intomainfrom
feature/improvment-pririty-1

Conversation

@saimizi
Copy link
Owner

@saimizi saimizi commented Dec 26, 2025

What's changed

  • Improve implementation.
  • Add new features.

saimizi and others added 3 commits December 26, 2025 13:34
- Add thiserror-based error types in src/errors.rs with specific variants
- Replace string-based errors with typed GhrError across all modules
- Eliminate .netrc parsing duplication in auth.rs by extracting helper functions
- Update all error handling to use automatic conversions via From trait
- Fix test assertions to work with new error types
- All 27 tests passing, clippy clean

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Priority 2 improvements:
- Extract hardcoded values to src/constants.rs (API endpoints, headers, defaults)
- Replace std::fs with tokio::fs for non-blocking file operations
- Replace std::process with tokio::process for async git commands
- Add exponential backoff retry logic for all GitHub API calls (max 3 retries)
- Update cli.rs to use constants for default values
- All 27 tests passing, clippy clean

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
…un, JSON output, and GitHub Enterprise support

This commit implements all Priority 3 enhancements from the improvement roadmap:

**New Features:**

1. Advanced Filtering Options (3.1)
   - Created filters module with support for glob patterns, regex, and exclusion
   - Smart pattern detection (regex → glob → substring priority)
   - Multiple filters with AND logic (comma-separated)
   - Examples: *.deb, linux-.*-amd64, !windows

2. JSON Output Format (3.2)
   - Added --format flag with table (default) and json options
   - Added Serialize trait to all data models
   - Machine-readable output for scripting and automation

3. Response Caching (3.3)
   - Created cache module with file-based caching (~/.cache/ghr/)
   - 24-hour TTL with automatic expiration
   - Added --cache flag to enable caching
   - Reduces API calls and improves performance

4. Dry-Run Mode (3.4)
   - Added --dry-run flag for preview mode
   - Shows what would be downloaded/cloned without executing
   - Displays asset sizes, total size, and destinations

5. GitHub Enterprise Support (3.5)
   - Added --api-url flag for custom API base URLs
   - Created _with_base variants for all endpoint builders
   - Created _with_cache variants for all GitHub API functions

**Implementation Details:**
- Added dependencies: regex (1.10), globset (0.4)
- Added error types: RegexError, GlobError, JsonError
- Created 2 new modules: filters.rs (122 lines), cache.rs (147 lines)
- Updated 9 files: cli.rs, constants.rs, errors.rs, github.rs, main.rs, models.rs, etc.
- Added 9 new tests (36 total tests, 100% pass rate)
- Clippy clean (only dead_code warnings for wrapper functions)

**Documentation:**
- Completely updated README.md with new feature documentation
- Added comprehensive examples for all new features
- Enhanced CI/CD pipeline examples
- Updated common use cases with new capabilities

**Files Changed:**
- New: src/cache.rs, src/filters.rs
- Modified: Cargo.toml, README.md, src/cli.rs, src/constants.rs,
  src/errors.rs, src/github.rs, src/main.rs, src/models.rs
- Total: +805 insertions, -98 deletions

All tests passing. Ready for release.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@saimizi saimizi merged commit 8c952f3 into main Dec 26, 2025
3 checks passed
@saimizi saimizi deleted the feature/improvment-pririty-1 branch December 26, 2025 05:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant